{% extends "base.html" %}

{% block title %}Checkin/Checkout{% endblock %}
{% block crumb %}&rsaquo; Check-in{% endblock %}

{% block onload %}setFocus();{% endblock %}

{% block content %}
	<script type="text/javascript">
		function setFocus() {
			document.getElementById("nameSearchField").focus();
		}
	</script>
	
	{% include "checkin/recent.html" %}
	
	{% include "checkin/navigation2.html" %}
  
  {% if message %}
    {{message}}
  {% endif %}
  <form action="" class="checkin" method="post">{% csrf_token %}
  	<p>
  	<label for="id_eventType">Event:</label>
  	<select name="eventType" id="id_eventType"> 
		<option value="I">Checkin</option> 
		<option value="O">Checkout</option>
	</select>
	</p>
	<p>
  	<script type="text/javascript">
		$(function() {
			setAutoComplete("nameSearchField", "nameResults", "nameSearchHidden", "/checkin/name_lookup/?query=");
		});
	</script>
	<label for="nameSearchField">Name:</label>
	<input type="text" id="nameSearchField" name="nameSearchField">
	</p>
	<p>
	<input type="hidden" name="userPk" id="id_userPk" />
	<input type="submit" class="checkinSubmit" value="Submit">
	</p>
  </form>
{% endblock %}